package net.siufung.security.granter;

import net.siufung.security.base.service.ICurrentUserService;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;
import org.springframework.security.oauth2.provider.TokenGranter;

/**
 * @author 陈建峰
 * @since 2022/7/15 4:34 下午
 */
@SuppressWarnings("deprecation")
public interface ITokenGranterProvider {

    /**
     * 获取授权的TokenGranter
     *
     * @param authorizationServerEndpointsConfigurer 授权服务配置
     * @param currentUserService 当前用户服务
     * @param authenticationManager 授权管理器
     * @return TokenGranter
     */
    TokenGranter getCompositeTokenGranter(AuthorizationServerEndpointsConfigurer authorizationServerEndpointsConfigurer,
                                          ICurrentUserService currentUserService,
                                          AuthenticationManager authenticationManager);
}
